<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表格的样式</title>
    <style>
        table{
            width:50%;
            border:1px solid black;
            margin:0 auto;
            /*指定边框之间的距离*/
            /* border-spacing: 0px; */
            /*设置边框的合并*/
            border-collapse: collapse;
        }
        td{
            border:1px solid black;
            height:100px;
            vertical-align: middle;
            text-align: center;
        }
/*如果表格中没有使用tbody，而是直接使用tr，那么浏览器会自动创建一个tbody，并且将tr全部放在tbody中*/
        table tr:nth-child(odd){
            background-color: aqua;
        }
        .box1{
            width:300px;
            height:300px;
            background-color: chartreuse;
            /*将元素设置为单元格*/
            display: table-cell;
            vertical-align: middle;
            
        }
        .box2{
            width:100px;
            height:100px;
            background-color: darkorange;
            margin:0 auto;
        }

    </style>
</head>
<body>
    <div class="box1">box1
        <div class="box2">box2</div>
    </div>
    <table>
        <tr>
            <td>学号</td>
            <td>姓名</td>
            <td>性别</td>
            <td>年龄</td>
            <td>地址</td>
        </tr>
        <tr>
            <td>1</td>
            <td>唐僧</td>
            <td>男</td>
            <td>58</td>
            <td>河南洛阳</td>
        </tr>
        <tr>
            <td>2</td>
            <td>孙悟空</td>
            <td>男</td>
            <td>28</td>
            <td>花果山</td>
        </tr>
        <tr>
            <td>3</td>
            <td>猪八戒</td>
            <td>男</td>
            <td>38</td>
            <td>高老庄</td>
        </tr>
        <tr>
            <td>4</td>
            <td>沙师弟</td>
            <td>男</td>
            <td>48</td>
            <td>流沙河</td>
        </tr>
    </table>
    
</body>
</html>